feat(keys): auto-bridge Deploy Key into ait profile by default#183
Merged
Conversation
`aitcc keys create` now saves the issued key to ~/.ait/credentials under the --name profile automatically, so `ait deploy --profile <name>` works immediately without a manual `ait token add` step. - default path: profile saved under --name value - --save-profile <other>: saves under the override name instead - --no-save-profile: disables saving (stdout-only, for CI pipes) - src/ait-token-profile.ts: mkdirSync now passes mode: 0o700 so the ~/.ait directory is created with the correct restrictive permissions - README ko + en: new "Deploy Key 발급" / "Issuing a Deploy Key" section - docs/api/api-keys.md: documents automatic save behaviour + opt-outs - New resolveProfileName() helper exported for unit testing - Tests: 8 new tests covering all three flag branches + SECRET-HANDLING
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aitcc keys create --name ci-deploynow automatically saves the issued Deploy Key to~/.ait/credentialsunder theci-deployprofile soait deploy --profile ci-deployworks immediately — no separateait token addstep required.--no-save-profileopt-out for CI pipes that store the key in an external secret manager (stdout-only).--save-profile <other>still works as an override for the profile name.~/.aitdirectory permissions:mkdirSyncnow usesmode: 0o700(was missing, defaulted to0755).docs/api/api-keys.md: documents automatic save behaviour,0600/0700permissions, and opt-out.README.md+README.en.md: new "Deploy Key 발급" / "Issuing a Deploy Key" section with one-shot workflow example.resolveProfileName()exported helper for clean unit testing.resolveProfileNamepure logic (all three flag branches + precedence) and 4 integration tests using_AIT_CREDENTIALS_PATH_OVERRIDE(credential write/no-write, override name, SECRET-HANDLING).Closes #182
Test plan
pnpm typecheck— cleanpnpm lint— clean (0 errors, 0 warnings)pnpm format— no changespnpm test— 664 pass, 20 skipped (pre-existingcli-subprocess.test.tsrequirespnpm build; unrelated to this PR)TEST_API_KEYnever appears in any stderr assertion_AIT_CREDENTIALS_PATH_OVERRIDEused throughout; real~/.ait/credentialsis never touched by tests